#ifndef __YMODEM_PORT_H__
#define __YMODEM_PORT_H__

typedef struct 
{
    /* 检测是否有输入，没有返回0，有返回1 */
    int (*tschar) (void);
    int (*putc)(char data);
    int (*getc)(void);
    void (*usdelay)(unsigned int time);
}ymodem_port_st;

/* 设置ymodem组建的接口 */
extern void set_ymodem_port(ymodem_port_st* ym_st);
/* 针对ymodem的外部接口 */
extern int ymodem_recv (long offset);
extern unsigned char ymodem_send (unsigned char *buf, const unsigned char* sendFileName, unsigned int sizeFile);
#endif  /* __YMODEM_PORT_H__ */
